package cn.itsy.dao;

import cn.itsy.pojo.Pactype;
import cn.itsy.pojo.Warntype;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class Pactypedaoimpl implements Pactypedao {
    @Resource
    private JdbcTemplate jt;

    @Override
    public List<Pactype> list(String sql) {
        List<Pactype> query = jt.query(sql, new BeanPropertyRowMapper<Pactype>(Pactype.class));
        return query;
    }

    @Override
    public void add(String sql) {
        jt.update(sql);
    }

    @Override
    public List<Pactype> idlist(String sql) {
        List<Pactype> query = jt.query(sql, new BeanPropertyRowMapper<Pactype>(Pactype.class));
        return query;
    }

    @Override
    public void update(String sql) {
        jt.update(sql);
    }

    @Override
    public void delete(String sql) {
        jt.update(sql);
    }
}
